<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>
<x:parse xml="${param.xmlstr}" var="xmlData"/>
<input type="hidden" name="zh_parsen/fzr_name"
       value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name"/>"/>
<input type="hidden" name="zh_parsen/fzr_mobile"
       value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile"/>"/>
<input type="hidden" name="zh_parsen/fzr_tel"
       value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/>"/>
<input type="hidden" name="zh_parsen/fzr_email"
       value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email"/>"/>
<div class="t_bar"><span class="color_red">*</span>${param.title}</div>
<table class="t_css" width="100%" border="0" cellpadding="0"
       cellspacing="1">
    <col style="width: 25%"/>
    <col style="width: 25%"/>
    <col style="width: 25%"/>
    <col style="width: 25%"/>
    <tr>
        <td align="right">项目名称：</td>
        <td colspan="3">
            <input type='text' name='proposal/zh_title' id='zh_title' style="width: 80%"
                   class="input_css required" maxlength="100"
                   value='<x:out select="$xmlData/data/proposal/zh_title"/>' label="项目名称">
        </td>
    </tr>
    <%--<tr>
        <td align="right">申请单位：</td>
        <td colspan="3">
            <span name="organizations/organization/org_name"><x:out select="$xmlData/data/organizations/organization[@submit_org='1']/org_name" /></span>
        </td>
    </tr>

    <tr>
        <td align="right">单位地址：</td>
        <td colspan="3">
            <span name="organizations/organization/address"><x:out select="$xmlData/data/organizations/organization[@submit_org='1']/address" /></span>
        </td>
    </tr>--%>
    <tr>
        <td align="right">归口管理单位：</td>
        <td colspan="3">
            <c:set var="recomend_org">{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value"/>','name':'<x:out
                    select="$xmlData/data/proposal/recomend_org_name"/>'}</c:set>
            <cpt:tree key="recommended_org" cacheable="false" className="hn_iuput_kuang " readonly="true"
                      value="${recomend_org}" label="归口管理单位"
                      id="recomend_org" showPattern="all" shieldPattern="0" topCheckbox="false"
                      onClick="initTreeValueExt"/>
            <input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value" class="required"
                   value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" label="归口管理单位">
            <input type="hidden" name="proposal/recomend_org_name"
                   value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
        </td>
    </tr>
    <tr>
        <td align="right">国家项目名称：</td>
        <td colspan="3">
            <input type='text' name='proposal/project_country_name' id='project_country_name' style="width: 80%"
                   class="input_css required " maxlength="100"
                   value='<x:out select="$xmlData/data/proposal/project_country_name"/>' label="国家项目名称">
        </td>
    </tr>
    <tr>
        <td align="right">国家项目计划类别（细化到专项）：</td>
        <td colspan="3">
            <input type='text' name='proposal/sub_type' id='sub_type' onfocus="changeTipsIn();"
                   onblur="changeTipsOut();" style="width: 80%" class="input_css required " maxlength="50"
                   value='<x:out select="$xmlData/data/proposal/sub_type"/>' label="国家项目计划类别">
        </td>
    </tr>
    <tr>
        <td align="right">项目主持人：</td>
        <td>
            <span name="proposal/fzr_name"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name"/></span>
        </td>
        <td align="right">主持人手机：</td>
        <td>
            <span name="proposal/fzr_mobile"><x:out
                    select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile"/></span>
        </td>
    </tr>
    <tr>
        <td align="right">联系电话：</td>
        <td>
            <span name="proposal/fzr_tel"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/></span>
        </td>
        <td align="right">电子邮箱：</td>
        <td>
            <span name="proposal/fzr_email"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email"/></span>
        </td>
    </tr>
    <tr>
        <td align="right">项目联系人：</td>
        <td>
            <input type="text" label="项目联系人" name="proposal/contact_psn_cname" class="input_css required"
                   maxlength="50" value="<x:out select="$xmlData/data/proposal/contact_psn_cname" />">
            <span name="proposal/contact_email" style="display: none;">
			    	<x:out select="$xmlData/data/organization_persons/organization_person[@psn_type='lianxiren']/contact_email"/>
		    	</span>
            <span name="proposal/contact_tel" style="display: none;">
			    	<x:out select="$xmlData/data/organization_persons/organization_person[@psn_type='lianxiren']/contact_tel"/>
		    	</span>
        </td>
        <td align="right">联系人手机：</td>
        <td>
            <input type="text" label="联系人手机" name="proposal/contact_psn_mobile" class="input_css required mobile"
                   maxlength="11" onfocus="InitInput.setNumber(this,11,0,0);"
                   value="<x:out select="$xmlData/data/proposal/contact_psn_mobile" />">
        </td>
    </tr>
    <tr>
        <td align="right">电子邮箱：</td>
        <td>
            <input name="proposal/contact_psn_email" class="dsPsn required email" label="电子邮箱" maxlength="50"
                   value="<x:out select="$xmlData/data/proposal/contact_psn_email" />"/>
        </td>
        <td align="right">通讯地址：</td>
        <td>
            <input name="proposal/contact_psn_address" class="dsPsn required" label="通讯地址" maxlength="100"
                   value="<x:out select="$xmlData/data/proposal/contact_psn_address" />"/>
        </td>
    </tr>
    <tr>
        <td align="right">国家项目编号：</td>
        <td>
            <input type='text' name='proposal/project_number' id='project_number'
                   class="input_css required" maxlength="50"
                   value='<x:out select="$xmlData/data/proposal/project_number"/>' label="国家项目编号">
        </td>
        <td align="right">项目总投入（万元）：</td>
        <td>
            <input type='text' name='proposal/project_investment' class="required" id='project_investment'
                   onfocus="InitInput.setNumber(this,9,4,2)" style="text-align: right;"
                   value='<x:out select="$xmlData/data/proposal/project_investment"/>' label="项目总投入">
        </td>
    </tr>
    <tr>
        <td align="right">国拨经费总额（万元）：</td>
        <td>
            <input type='text' name='proposal/eq_money_togal' class="required" id='eq_money_togal'
                   onfocus="InitInput.setNumber(this,9,4,2)" style="text-align: right;"
                   value='<x:out select="$xmlData/data/proposal/eq_money_togal"/>' label="国拨经费总额">
        </td>
        <td align="right">上年国拨经费（万元）：</td>
        <td>
            <input type='text' name='proposal/step_num' id='step_num' class="required"
                   onfocus="InitInput.setNumber(this,9,4,2)" style="text-align: right;"
                   value='<x:out select="$xmlData/data/proposal/step_num"/>' label="上年国拨经费">
        </td>
    </tr>
    <tr>
        <td align="right">拉动社会投入（万元）：</td>
        <td>
            <input type='text' name='proposal/social_investment' id='social_investment' class="required"
                   onfocus="InitInput.setNumber(this,9,4,2)" style="text-align: right;"
                   value='<x:out select="$xmlData/data/proposal/social_investment"/>' label="拉动社会投入">
        </td>
        <td align="right">申请省补助资金（万元）：<br/>（按5%计算）</td>
        <td>
            <input type='text' name='proposal/request_amt' class="required" id='request_amt'
                   onfocus="InitInput.setNumber(this,9,4,2)" style="text-align: right;"
                   value='<x:out select="$xmlData/data/proposal/request_amt"/>' label="申请省补助资金（万元）（按5%计算）">
        </td>
    </tr>
    <%--<tr>
        <td align="right">项目报审级次：<br/>（省补助资金拨付所属财政局）</td>
        <td colspan="3">
            <c:set var="sub_step">{'id':'<x:out select="$xmlData/data/proposal/sub_step_value" />','name':'<x:out select="$xmlData/data/proposal/sub_step_name" />'}</c:set>
              <cpt:tree key="sub_step" cacheable="false" className="hn_iuput_kuang  " readonly="true" value="${sub_step}"  label="项目报审级次"
                  id="sub_step" onlyChooseLeaf="false" showPattern="all" shieldPattern="0" topCheckbox="true" onClick="initTreeValueExt" />
            <input id="sub_step_value" type="hidden" name="proposal/sub_step_value" class="required" label="项目报审级次" value="<x:out select="$xmlData/data/proposal/sub_step_value" />"/>
            <input id="sub_step_name" type="hidden" name="proposal/sub_step_name"  value="<x:out select="$xmlData/data/proposal/sub_step_name" />"/>
        </td>--%>
    </tr>
</table>
<script type="text/javascript">
    $(function () {
        changeTipsOut();
    });

    function initTreeValueExt(treeId, treeNode) {
        if ((treeNode && treeNode.isParent)) {
            scmWarn("请选择具体的" + $("#" + treeId).attr("label"));
            $("#" + treeId).val("");
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val("");
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val("");
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val("");
            return false;
        }
        var str = treeNode.name;
        var obj = treeNode.parentNode;
        while (obj != null) {
            str = obj.name + "-" + str;
            obj = obj.parentNode;
        }

        $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
    }

    function changeTipsIn() {
        var str = $("#sub_type").val();
        if (str == "" || str == "例：国家重点研究与开发计划纳米科技专项") {
            $("#sub_type").val("");
            $("#sub_type").css('color', 'black');
        }
    }

    function changeTipsOut() {
        var str = $("#sub_type").val();
        if (str == "" || str == "例：国家重点研究与开发计划纳米科技专项") {
            $("#sub_type").val("例：国家重点研究与开发计划纳米科技专项");
            $("#sub_type").css('color', 'red');
        }
    }
</script>		
